// 如果没有通过拦截器配置域名的话，可以在这里写上完整的URL(加上域名部分)
let query1 = '/app/query';
let query = '/app/mine/query';
let query2 = '/s/a';
let code = '/app/login/code';
let phoneCode = '/app/msg/send';
let login = '/app/login/restful';
let signature = '/wx/scan/signature';
// let signature = '/wx/auth/signature';
let detail = '/web/query/detail';
let trace = '/app/trace';
let check = '/web/code/check';
let wxlogin = '/wx/scan/wxLogin';
let figo = 'web/code/figo';
let mappingLocate = '/area/mapping/locate';
let open = '/query/open';
let open1 = '/o/a';//asyone  @one/v1
let redPack = '/wx/red/packet/mini';
let mini_secret_check = '/web/mini/secret/check'
let packet_transfer = '/wx/red/packet/transfer/change'

// 此处第二个参数vm，就是我们在页面使用的this，你可以通过vm获取vuex等操作，更多内容详见uView对拦截器的介绍部分：
// https://uviewui.com/js/http.html#%E4%BD%95%E8%B0%93%E8%AF%B7%E6%B1%82%E6%8B%A6%E6%88%AA%EF%BC%9F
const install = (Vue, vm) => {
	// 标签验证查询
	let labelQuery = (params = {}) => vm.$u.get(query, params);
	// 标签查询
	let labelQuery1 = (params = {}) => vm.$u.get(query1, params);
	// 标签查询2
	let labelQuery2 = (params = {}) => vm.$u.get(query2, params);
	// 手机验证码
	let getPhoneCode = (params = {}) => vm.$u.post(phoneCode, params);
	// 验证码
	let getCode = (params = {}) => vm.$u.get(code, params);
	// 登录
	let phoneLogin = (params = {}) => vm.$u.post(login, params);
	// 微信认证
	let getSignature = (params = {}) => vm.$u.post(signature, params);
	// 位置信息
	let queryDetail = (params = {}) => vm.$u.post(detail, params);
	// 溯源信息
	let getTraceInfo = (params = {}) => vm.$u.get(trace, params);
	// 二次校验
	let secondCheck = (params = {}) => vm.$u.post(check, params);
	// 微信登录
	let wxLogin = (params = {}) => vm.$u.get(wxlogin, params);
	// figo微信红包
	let receive = (params = {}) => vm.$u.post(figo, params);
	// 根据经纬度获取地址信息
	let areaMappingLocate = (params = {}) => vm.$u.get(mappingLocate,params)
	// 开放接口
	let openApi = (params = {}) => vm.$u.get(open,params)
	// 开放接口
	let openApi1 = (params = {}) => vm.$u.get(open1,params)
	// 小程序红包
	let redpack = (params = {}) => vm.$u.post(redPack, params);
	// 小程序红包校验
	let miniSecretCheck = (params = {}) => vm.$u.post(mini_secret_check, params);
	// 商家转账到零钱
	let packetTransfer = (params = {}) => vm.$u.post(packet_transfer, params);
	
	
	
	// 将各个定义的接口名称，统一放进对象挂载到vm.$u.api(因为vm就是this，也即this.$u.api)下
	vm.$u.api = {
		labelQuery,
		labelQuery1,
		labelQuery2,
		getPhoneCode,
		getCode,
		phoneLogin,
		getSignature,
		queryDetail,
		getTraceInfo,
		secondCheck,
		wxLogin,
		receive,
		areaMappingLocate,
		openApi,
		openApi1,
		redpack,
		miniSecretCheck,
		packetTransfer
	};
}

export default {
	install
}
